<%@ page contentType="text/html;charset=UTF-8" language="java"%>
<%@ include file="/WEB-INF/views/include/taglib.jsp"%>
<%--推动转化率录入--%>
<style>
	.error {
		color: red;
	}

</style>
<form:form commandName="capitalFilter" cssClass="form-horizontal"
	role="form" onsubmit="return false;">



	<div class="form-group">
		<label class="col-sm-2 control-label no-padding-right">*申报单号</label>
		<div class="col-sm-4">
			<input type="text" name="summaryId" id="summary-Id"
				placeholder="请输入申报单号" value="${capitalFilter.summaryId}"
				class="form-control required">
		</div>

		<label class="col-sm-2 control-label no-padding-right"
			   for="totalInver">*注册或备案金额</label>
		<div class="col-sm-4">
			<input type="text" name="totalInver" id="totalInver"
				   placeholder="请输入申报全额" value="${capitalFilter.totalInver}"
				   class="form-control required">
		</div>
	</div>

	<div class="form-group">
		<label class="col-sm-2 control-label no-padding-right"
			   for="investorName">*投资方名</label>
		<div class="col-sm-4">
			<input type="text" name="investorName" id="investor-Name"
				   placeholder="请输入投资方名称" value="${capitalFilter.investorName}"
				   class="form-control required">
		</div>

		<label class="col-sm-2 control-label no-padding-right"
			   for=projectName>*项目名称</label>
		<div class="col-sm-4">
			<input type="text" name="projectName" id="project-Name"
				   placeholder="请输入项目名称" value="${capitalFilter.projectName}"
				   class="form-control required">
		</div>

	</div>

	<div class="form-group">

		<label class="col-sm-2 control-label no-padding-right"
			   for="projectStatus">*项目状态</label>
		<div class="col-sm-4">
			<select name="projectStatus" class="form-control required"
					style="width: 100%" data-placeholder="请选择" id="projectStatus">
				<option value="${capitalFilter.projectStatus}">${capitalFilter.projectStatus}</option>
				<option value="项目无法落地">项目无法落地</option>
				<option value="仍在审批阶段、未办结">仍在审批阶段、未办结</option>
				<option value="已开工建设、未建成投产或正式营业">已开工建设、未建成投产或正式营业</option>
			</select>
		</div>


		<label class="col-sm-2 control-label no-padding-right"
			   for="explains">*说明</label>
		<div class="col-sm-4">
			<input type="text" name="explains" id="explains"
				   placeholder="请输入说明，必填" value="${capitalFilter.explains}"
				   class="form-control required">
		</div>
	</div>

	<div class="form-group">
		<label class="col-sm-2 control-label no-padding-right"
			   for="isnnu">*是否纳统</label>
		<div class="col-sm-4">
			<select name="isnnu" class="form-control required"
					style="width: 100%" data-placeholder="请选择" id="isnnu">
				<option value="${capitalFilter.isnnu}">
					<c:if test="${capitalFilter.isnnu == 0}"><p>否</p></c:if>
					<c:if test="${capitalFilter.isnnu == 1}"><p>是</p></c:if>
				</option>
				<option value="0">否</option>
				<option value="1">是</option>
			</select>
		</div>

			<label class="col-sm-2 control-label no-padding-right"
				   for="isRatepay">*是否纳税</label>
			<div class="col-sm-4">
				<select name="isRatepay" class="form-control required"
						style="width: 100%" data-placeholder="请选择" id="isRatepay">
					<option value="${capitalFilter.isRatepay}">
						<c:if test="${capitalFilter.isRatepay == 0}"><p>否</p></c:if>
						<c:if test="${capitalFilter.isRatepay == 1}"><p>是</p></c:if>
					</option>
					<option value="0">否</option>
					<option value="1">是</option>
				</select>
		</div>

	</div>




	<div class="form-group">
		<label class="col-sm-2 control-label no-padding-right"
			   for="notes">存在问题</label>
		<div class="col-sm-4">
			<input type="text" name="notes" id="notes"
				   placeholder="如有存在问题请输入" value="${capitalFilter.notes}"
				   class="form-control ">
		</div>

		<label class="col-sm-2 control-label no-padding-right"
			   for="isOpen">*是否开业</label>
		<div class="col-sm-4">
			<select name="isOpen" class="form-control required"
					style="width: 100%" data-placeholder="请选择" id="isOpen">
				<option value="${capitalFilter.isOpen}">
					<c:if test="${capitalFilter.isOpen == 0}"><p>否</p></c:if>
					<c:if test="${capitalFilter.isOpen == 1}"><p>是</p></c:if>
				</option>
				<option value="0">否</option>
				<option value="1">是</option>
			</select>
		</div>


	</div>

	<div class="form-group">
		<label class="col-sm-2 control-label no-padding-right" for="taxproof">佐证材料</label>
		<input class="col-sm-4" type="file" id="fileupload" name="files"
			   accept=".zip"/> <br>

		<button class="col-sm-5 btn btn-large btn-primary" id="btn">上传</button>

		<input type="text" name="taxproof" id="taxproof"
			   value="${capitalFilter.taxproof}" class="form-control "
			   style="display: none" />
		<input type="text" name="isaudit" id="isaudit"
			   value="${capitalFilter.isaudit}" class="form-control "  style="display: none"
		/>
	</div>






	<form:hidden path="sysId" />
</form:form>
<script src="<s:url value="/assets/js/chosen.jquery.js"></s:url>"></script>
<script src="<s:url value="/assets/js/ajaxfileupload.js"></s:url>"></script>
<script src="<s:url value="/assets/js/jquery-ui.js"></s:url>"></script>
<%--
<div id="dialog" title="提示">
	<div class="progress progress-striped active">
		<div class="progress-bar progress-bar-success" role="progressbar"
			aria-valuenow="60" aria-valuemin="0" aria-valuemax="100"
			style="width: 100%;"></div>

	</div>
	<p>正在上传 请稍后……</p>
</div>--%>
    <script type="text/javascript">
	/*$('#editor1').ace_wysiwyg({
		toolbar : [ 'font', null, 'fontSize', null, {
			name : 'bold',
			className : 'btn-info'
		}, {
			name : 'italic',
			className : 'btn-info'
		}, {
			name : 'strikethrough',
			className : 'btn-info'
		}, {
			name : 'underline',
			className : 'btn-info'
		}, null, {
			name : 'createLink',
			className : 'btn-pink'
		}, {
			name : 'unlink',
			className : 'btn-pink'
		}, null, {
			name : 'insertImage',
			className : 'btn-success'
		}, null, 'foreColor', null, {
			name : 'undo',
			className : 'btn-grey'
		}, {
			name : 'redo',
			className : 'btn-grey'
		} ]
	});*/


	/*$("#dialog").hide();*/
	$("#btn").click(function() {
		var fileval = $("#fileupload").val();
		if (fileval == null || fileval == "") {
			alert("未选择任何文件");
			return;
		}
        $(".shade").fadeIn(100);
        $(".warning").fadeIn(100);
        $('.la-square-jelly-box').show();
        showShade();
        //警告框自定义内容
        $('.warning>.title>em').html('加载中……');
/*
		$("#dialog").show();
		$("#dialog").dialog();*/
		$.ajaxFileUpload({
			type : "post",
			fileElementId : "fileupload",
			secureuri : false,
			dataType : 'json',
			url : "/pictureUpload/uploadBatch",
			async : false,
			success : function(data) {
				var val = data.data.sysid;
				//console.log(val);
				$("#taxproof").attr("value", val);
				/*$("#dialog").dialog("close");*/
                $('.warning>.title>em').html('上传成功');
                $('#btn').html('文件已上传');
			},
			error : function(data) {
			   /* console.log(data);
				$("#dialog").dialog("close");*/
				alert("佐证材料上传失败 ！！请联系管理员");
			}

		});

	});
	var isauditval = $("#isaudit").val();
	//console.log(isauditval);
	if(isauditval=='1'){
		$("#updatebtn").attr("disabled", true);
		//console.log(isauditval+"111");
	}

	function findtwoClass() {
		var teamID = $("#teamClass").val();
		//alert(teamID);
		var teamcla = {
			"teamId" : teamID
		};
		$.ajax({
			url : "/chart/show/getTeamclassNames",
			dataType : "json", //返回数据形式为json
			type : "POST",
			contentType : 'application/json;charset=UTF-8',
			data : JSON.stringify(teamcla),
			success : function(data) {
				$("#teamname option").remove();
				$("#teamname").append(" <option value='00'>请选择</option>");
				for (var i = 0; i < data.data.length; i++) {
					var teamid = data.data[i].teamId;
					var teamname = data.data[i].teamName;
					$("#teamname").append(
							"<option value='"+teamname+"'>" + teamname
									+ "</option>");
					//console.log(teamname);
				}
			}
		});

	}

	$("#summary-Id").blur(function () {
		 console.log("meiy jiaodian ");
		 var summaryid= $("#summary-Id").val();
		 console.log("id"+summaryid);
        $.ajax({
            url : "/chart/show/getProjectName",
            dataType : "json", //返回数据形式为json
            type : "POST",
            contentType : 'application/json;charset=UTF-8',
            data : JSON.stringify({"summaryId" : summaryid}),
            success : function(data) {
                console.log(data);
                if(data.data){
                    $("#project-Name").attr("value",data.data.projectName);
                    $("#investor-Name").attr("value",data.data.investorName);
				}else
				{
				   // 警告框
                    $(".shade").fadeIn(100);
                    $(".warning").fadeIn(100);
                    showShade();
                    //警告框自定义内容
                    $('.warning>.cont').html('对不起，找不到这个项目，请确认申报单号是否正确');
					$("#summary-Id").val("");
				}
            }
        });

    });
</script>
